home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: in2.uu.net!world!news
- From: Chris Gould <slide@world.std.com>
- Subject: Casting pointer to member function to pointer to function
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <314CD34A.7DBB@world.std.com>
- Sender: news@world.std.com (Mr Usenet Himself)
- Nntp-Posting-Host: world.std.com
- Content-Transfer-Encoding: 7bit
- Organization: The World @ Software Tool & Die
- Mime-Version: 1.0
- Date: Mon, 18 Mar 1996 03:06:50 GMT
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Hi all,
-
- I can't seem to get this to work and can't figure if it's even legal. I
- have a global function that takes as an argument a pointer to function.
- The pointer to function is defined as
-
- long (__stdcall *)(void *,unsigned int,unsigned int,long)
-
- I would like to pass a function that is a member of a class called CGWnd
- to this function which would be defined as:
-
- long (__stdcall CGWnd::*)(void *,unsigned int,unsigned int,long)
-
- I've tried casting but but MSVC++ gives me an error that effectively
- says I can't cast away the function's class membership. Anyone know if
- there is a way around this?
-
- Thanks,
- Chris
-